/**
 * 
 */
package gui.view;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * @author Elisa Costante
 * 
 */
public class CustomTableCellRenderer extends DefaultTableCellRenderer {

	private static final long serialVersionUID = -4395389534866530636L;

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		Component cell = super.getTableCellRendererComponent(table, value,
				isSelected, hasFocus, row, column);

		if (column == (row + 1)) {
			cell.setBackground(Color.LIGHT_GRAY);
			cell.setForeground(Color.black);
		} else {
			cell.setBackground(Color.white);
			cell.setForeground(Color.black);
		}
		return cell;
	}
}